package com.ch.forum.dao;

import com.ch.forum.model.ArtHistoryModel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ArtHistoryMapper {

    @Insert("insert into t_article_history(art_id,date,user_id)" +
            " values(#{artId},#{date},#{userId})")
    int addHistory(ArtHistoryModel model);

    @Select("select count(0) from t_article_history where user_id = #{userId}")
    Long countNum(@Param("userId")Long userId);
}
